﻿using System.ServiceProcess;

namespace OMR.EasyBackup.WindowsService
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        //static SqlServerBackupManager sqlBackup = new SqlServerBackupManager();
        //static Guid userId = new Guid("51091ec7-73b5-4409-bb40-732df0e4e5cd");

        ////static void Main(string[] args)
        ////{

        ////}

        //private static void onFileDeleted(object sender, FileDeletedEventArgs e)
        //{
        //    sqlBackup.Delete(userId, e.FullPath);
        //}

        //private static void onFileContentChanged(object sender, FileContentChangedEventArgs e)
        //{
        //    Console.WriteLine("content changed");
        //    sqlBackup.Update(userId, e.FullPath, e.Content);
        //}

        //private static void onFileRenamed(object sender, FileRenamedEventArgs e)
        //{
        //    sqlBackup.Rename(userId, e.OldFullPath, e.NewFullPath);
        //}

        //private static void onFileCreated(object sender, FileCreatedEventArgs e)
        //{
        //    sqlBackup.Create(userId, e.FullPath, e.Content);
        //}

        //WatcherBase w;

        protected override void OnStart(string[] args)
        {
            //w = new FSWatcher(@"D:\Proje\Dropbox\", "*.*");

            //w.OnFileCreated += onFileCreated;
            //w.OnFileRenamed += onFileRenamed;
            //w.OnFileDeleted += onFileDeleted;
            //w.OnFileContentChanged += onFileContentChanged;

            //w.Start();
        }

        protected override void OnStop()
        {
            //w.Stop();
        }
    }
}
